package com.cn.jiyun.service.impl;


//import com.cn.jiyun.FoodFeignClient;

import com.cn.jiyun.FoodFeignClient;
import com.cn.jiyun.entity.pojo.Food;
import com.cn.jiyun.entity.pojo.Meals;
import com.cn.jiyun.entity.pojo.Vouchers;
import com.cn.jiyun.service.FoodService;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FoodServiceImpl implements FoodService {
    @Autowired
    private FoodFeignClient foodFeignClient;
    @Override
    public List<Food> findAllFood() {
      return foodFeignClient.findAllFood().getData();
    }

    @Override
    public List<Food> findFoodOrderByRating(Integer rating) {
        return foodFeignClient.findFoodOrderByRating(rating).getData();
    }

    @Override
    public Food getFoodId(Integer foodId) {
        return foodFeignClient.findById(foodId).getData();
    }

    @Override
    public List<Vouchers> findVouchers(Vouchers vouchers) {
        return foodFeignClient.findVouchers(vouchers).getData();
    }

    @Override
    public List<Meals> findMeals(Meals meals) {
        return foodFeignClient.findMeals(meals).getData();
    }

    @Override
    public Meals getMealById(Integer packageId) {
        return foodFeignClient.findMealById(packageId).getData();
    }

}
